<template>
	<view class="order-box">
		<!-- <view class="order-nor" v-show="orderType == 2">
			<view class="order-nor-left">订单编号：2022060101123212</view>
			<view class="order-nor-right">待结算</view>
		</view> -->
		<view class="order-item">
			<image class="order-img" :src="orderObj.image ? $IMG_URL+orderObj.image : $IMG_URL+orderObj.image" mode=""></image>
			<view class="order-right">
				<view class="order-right-top">{{ orderObj.name ?orderObj.name : orderObj.name}}</view>
				<view class="order-right-bottom">
					<view class="order-right-bottom-left"><text>{{isJifen == 1 ? '￥':'积分:'}}</text>{{ orderObj.price ? orderObj.price :orderObj.price}}</view>
					<!-- <view class="order-right-bottom-right" v-show="orderType == 1 || orderType == 2 ">
						x{{orderObj.num}}</view> -->
					<view class="order-right-bottom-right-sale" v-show="orderType == 5">待卖出</view>
				</view>
			</view>
		</view>
		<view v-show="orderType == 2 || orderType == 3" class="diver"></view>
<!-- 		<view class="order-time" v-show="orderType == 2">
			<view class="order-time-left">2024.02.13 14:32:21</view>
			<view class="order-time-right">
				共1件商品<text class="order-time-right-1">合计</text><text class="order-time-right-2">￥</text>
				<text class="order-time-right-3">1000</text>
			</view>
		</view> -->
		<view class="order-all" v-show="orderType == 3">
			<view>{{isJifen == 1 ? '商品总额':'商品总积分'}}</view>
			<view>{{isJifen == 1 ? '￥':'积分:'}}{{orderObj.pay_price ? orderObj.pay_price : orderObj.total_price}}</view>
		</view>
		<view class="warehouse-btns" v-show="orderType == 4">
			<view class="warehouse-btns-left" @click.stop="navigator('/pages/me/consignment/consignment')">寄售</view>
			<view class="warehouse-btns-right"
				@click.stop="navigator('/pages/message/confirmOrder/confirmOrder?confirmType='+2+'&confirmTitle='+'发货')">
				发货</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "order-list",
		props: {
			isJifen:{
				detailType: [Boolean, String],
				default: () => 1 //1 其他 2 积分
			},
			orderObj: {
				type: Object,
				default: () => {}
			},
			orderType: {
				detailType: [Number, String],
				default: () => 1 //1不展示订单编号其他 2 展示订单编号以及时间 3商品总额 详情 4.我的仓库 5我的寄售
			}
		},
		data() {
			return {
			};
		},
		methods: {
			navigator(url) {
				if (this.orderType == 5) {
					uni.navigateTo({
						url: '/pages/index/shopDetail/shopDetail?detailType=3'
					})
				} else {
					uni.navigateTo({
						url: url
					})
				}

			}
		}
	}
</script>

<style lang="scss">
	.order-box {
		background-color: #fff;
		padding: 20rpx;
		.order-nor {
			display: flex;
			justify-content: space-between;
			margin-bottom: 30rpx;

			.order-nor-left {
				font-weight: 400;
				font-size: 26rpx;
				color: #666666;
			}

			.order-nor-right {
				font-weight: 500;
				font-size: 28rpx;
				color: #6FAD19;
			}
		}

		.order-item {
			display: flex;

			.order-img {
				width: 200rpx;
				height: 200rpx;
				border-radius: 20rpx;
			}

			.order-right {
				width: 440rpx;
				margin-left: 20rpx;

				.order-right-top {
					font-size: 28rpx;
					color: #333333;
				}

				.order-right-bottom {
					display: flex;
					justify-content: space-between;
					margin-top: 60rpx;

					.order-right-bottom-left {
						font-weight: bold;
						font-size: 32rpx;
						color: #DD0403;

						text {
							font-size: 22rpx;
						}
					}

					.order-right-bottom-right {
						font-weight: 400;
						font-size: 24rpx;
						color: #999999;
					}

					.order-right-bottom-right-sale {
						font-weight: 500;
						font-size: 28rpx;
						color: #6FAD19;
					}
				}
			}
		}

		.diver {
			width: 654rpx;
			height: 1rpx;
			background: #EEEEEE;
			margin: 30rpx 0;
		}

		.order-all {
			display: flex;
			justify-content: space-between;
			font-weight: 500;
			font-size: 28rpx;
			color: #333333;
			margin-top: 20rpx;
		}

		.order-time {
			display: flex;
			justify-content: space-between;

			.order-time-left {
				font-weight: 500;
				font-size: 24rpx;
				color: #999999;
				margin-top: 10rpx;
			}

			.order-time-right {
				font-weight: 400;
				font-size: 20rpx;
				color: #666666;

				.order-time-right-1 {
					margin: 0 20rpx;
				}

				.order-time-right-2 {
					font-weight: bold;
					font-size: 22rpx;
					color: #333333;
				}

				.order-time-right-3 {
					font-weight: bold;
					font-size: 32rpx;
					color: #333333;
				}
			}
		}

		.warehouse-btns {
			display: flex;
			justify-content: flex-end;
			margin-top: 20rpx;

			.warehouse-btns-left {
				width: 144rpx;
				height: 56rpx;
				background: #F6F6F6;
				border-radius: 50rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: #333333;
				line-height: 56rpx;
				text-align: center;
				margin-right: 20rpx;
			}

			.warehouse-btns-right {
				width: 144rpx;
				height: 56rpx;
				background: linear-gradient(90deg, #6AAE2B 0%, #1B7E38 100%);
				border-radius: 50rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: #FFFFFF;
				line-height: 56rpx;
				text-align: center;
			}
		}
	}
</style>